<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div>
		
	</div>
	<canvas id="canvas" width="600" height="600"></canvas>
	<script>
	var canvas = document.getElementById('canvas'),
		context = canvas.getContext('2d');
	var gradient = context.createLinearGradient(0,0,canvas.width,canvas.height)
console.log(gradient)
	gradient.addColorStop(0,'blue')
	gradient.addColorStop(0.25,'white')
	gradient.addColorStop(0.5,'purple')
	gradient.addColorStop(0.75,'red')
	gradient.addColorStop(1,'yellow')

	context.fillStyle = gradient
	context.fillRect(0,0,canvas.width,canvas.height)
	</script>
</body>
</html>